package com.smart.manager.system.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.smart.common.entities.ajax.AjaxResult;
import com.smart.common.entities.constant.SmartConstant;
import com.smart.common.entities.core.Page;
import com.smart.manager.system.entities.body.RSystemScheduleRecord;
import com.smart.manager.system.entities.models.SystemScheduleRecord;
import com.smart.manager.system.repository.ScheduleRecordRepository;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author Administrator
 */

@Api(tags = "任务管理")
@RestController
@RequestMapping(SmartConstant.MANAGER_API_PREFIX + "system/schedule/record")
@RequiredArgsConstructor
public class ScheduleRecordApi {

    private final ScheduleRecordRepository scheduleRecordRepository;

    @GetMapping(value = "pageList")
    @ApiOperation(value = "查询记录")
    @SaCheckPermission("system:schedule:record:pageList")
    public AjaxResult<Page<SystemScheduleRecord>> pageList(@Validated RSystemScheduleRecord.SearchBody body) {
        Page<SystemScheduleRecord> result = scheduleRecordRepository.pageList(body);
        return AjaxResult.data(result);
    }


}
